package com.wyd.wenyongdaAdmin.commons.model.admin.menu.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Component
@Data
@EqualsAndHashCode
@ToString
public class TreeMenuDTO implements Serializable {

    private static final long serialVersionUID = -6909852224466369169L;
    /**
     * id
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Long id;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String title;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String enname;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Long parentId;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String path;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String component;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private String icon;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Integer sort;
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    // 出参格式化
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    /**
     * 是否启用
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private Integer isEnabled;

    /**
     * 子树
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    private List<TreeMenuDTO> children;
}
